<template>
    <div class="panel_wrap">
        <div class="header">
            <div class="title">{{title}}</div>
            <div class="desc">
                <slot name="header-desc"></slot>
            </div>
        </div>
        <div class="content">
            <div class="subject">
                {{prefixUnit}} {{num|separateNum}} {{suffixUnit}}
            </div>
            <div class="desc">
                <slot name="content-desc"></slot>
            </div>
        </div>
        <div class="footer">
            <div class="ft_desc">
                <slot name="footer-desc"></slot>
            </div>
            <div class="ft_num">
                <slot name="footer-num"></slot>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'DataGroup',
        props: {
            title: {
                type: String,
                default: ''
            },
            prefixUnit: {
                type: String,
                default: ''
            },
            suffixUnit: {
                type: String,
                default: ''
            },
            num: {
                type: Number,
                default: 0
            }
        }
    }
</script>

<style lang="scss" scoped>
.panel_wrap{
    display: flex;
    flex-direction: column;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all .2s ease-in-out;
    .header{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        border-bottom: 1px solid #e8eaec;
        height: 30px;
        .title{
            font-size: 16px;
            color: #17233d;
            font-weight: 500;
        }
    }
    .content{
        display: flex;
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid #e8eaec;
        .subject{
            font-size: 30px;
        }
    }
    .footer{
        display: flex;
        justify-content: space-between;
        padding: 10px;
    }
}

</style>
